import dotenv from 'dotenv';
dotenv.config();

const config = {
  development: {
    host: process.env.REDIS_HOST || 'localhost',
    port: parseInt(process.env.REDIS_PORT) || 6379,
    password: process.env.REDIS_PASSWORD || undefined,
    db: 0,
    retryDelayOnFailover: 100,
    maxRetriesPerRequest: 3
  },

  production: {
    host: process.env.PROD_REDIS_HOST || '58.251.126.79',
    port: parseInt(process.env.REDIS_PORT) || 56379,
    password: process.env.PROD_REDIS_PASSWORD,
    db: 0,
    retryDelayOnFailover: 100,
    maxRetriesPerRequest: 3
  }
};

const env = process.env.NODE_ENV || 'development';
export default config[env];
